import { numToFixed } from "@/components/Table/utils"
// 数据总览 静态表头配置
export const columns = [
  {
    type: "selection",
    align: "center",
  },
  {
    label: "产品名称",
    prop: "fundName",
    fixed: "left",
    type: "managerHref",
    fundType: "",
    width: "200",
  },
  {
    label: "产品代码",
    prop: "fundCode",
    fixed: "left",
    width: "100",
  },
  {
    label: "调入日期",
    sortable: "custom",
    prop: "inDate",
    width: "120",
  },
  {
    label: "基金公司",
    prop: "fundCorp",
    width: "120",
  },

  {
    label: "基金经理",
    prop: "managerNameField",
    isRequest2manager: true,
    type: "managerHref",
    managerNameField: "fundManagerName",
    managerCodeField: "fundManagerId",
    fundType: "",
    width: "200",
  },
  {
    label: "一级分类",
    prop: "windType1",
    width: "125",
  },
  {
    label: "成立日期",
    sortable: "custom",
    width: "120",
    prop: "setupDateStr",
  },
  {
    label: "指数基金",
    type: "style",
    formatterClass: row => {
      if (row.isIndexFund == 1) {
        return "consignment consignment_y"
      } else {
        return "consignment consignment_n"
      }
    },
    formatter: row => {
      if (row.isIndexFund == 1) {
        return "是"
      } else {
        return "否"
      }
    },
  },
  {
    label: "最新净值",
    prop: "navUnit",
    type: "style",
    sortable: "custom",
    formatterClass: row => {
      return ""
    },
    formatter: row => {
      return numToFixed({ num: row.navUnit, toFixedInt: 2 })
    },
  },
  {
    label: "最新规模(亿元)",
    prop: "foundScale",
    type: "style",
    sortable: "custom",
    formatterClass: row => {
      return ""
    },
    formatter: row => {
      return numToFixed({ num: row.foundScale, toFixedInt: 2 })
    },
    width: 130,
  },
  {
    label: "日涨跌",
    prop: "dayReturn",
    sortable: "custom",
    type: "withColorRatio",
    percentFormat: 4,
  },
  {
    label: "累积收益",
    prop: "returnRateAcc",
    sortable: "custom",
    type: "withColorRatio",
    percentFormat: 4,
  },
  {
    label: "今年收益",
    prop: "returnRateYtd",
    sortable: "custom",
    type: "withColorRatio",
    percentFormat: 4,
  },
  {
    label: "年化收益",
    prop: "annualReturnRate",
    sortable: "custom",
    type: "withColorRatio",
    percentFormat: 4,
  },
  {
    label: "最大回撤",
    prop: "mdd",
    sortable: "custom",
    type: "withColorRatio",
    percentFormat: 4,
  },
  {
    label: "同类排名",
    prop: "returnRateRank",
    sortable: "custom",
    description: "近一年收益排名",
  },

  {
    label: "夏普比率",
    prop: "sharpe",
    type: "style",
    sortable: "custom",
    formatterClass: row => {
      return ""
    },
    formatter: row => {
      return numToFixed({ num: row.sharpe, toFixedInt: 2 })
    },
  },
  // {
  //   type: "style",
  //   label: "是否代销",
  //   prop: "isSell",
  //   sortable: "custom",
  //   formatterClass: row => {
  //     if (row.isSell == 1) {
  //       return "consignment consignment_y"
  //     } else {
  //       return "consignment consignment_n"
  //     }
  //   },
  //   formatter: row => {
  //     if (row.isSell == 1) {
  //       return "是"
  //     } else {
  //       return "否"
  //     }
  //   },
  // },

  // {
  //   label: "一级分类",
  //   prop: "windType1",
  // },

  // {
  //   label: "申购状态",
  //   prop: "purchaseStatus",
  // },
  // {
  //   label: "赎回状态",
  //   prop: "redeemStatus",
  // },

  // {
  //   label: "操作人",
  //   prop: "userName",
  // },
]
